package Test;
import java.util.Scanner;
public class test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long x = scanner.nextLong();
        scanner.close();
        long y = Square(x);
        System.out.println(y);
    }

    private static long Square(long x) {
        long a = (long) Math.sqrt(x);//计算x的平方根并且向下取整
         //计算a的平方和（a+1）的平方
        long aSquared = a * a;
        long bSquared = (a + 1) * (a + 1);
        //比较x与a的平方和b的平方的差值，返回差值较小的那个平方
        if (x - aSquared <=  bSquared - x) {
            return aSquared;
        }else {
            return bSquared;
        }
    }
}
